package cn.magic.controller;

import cn.magic.domain.User;
import cn.magic.feign.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {

    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/user/{id}")
    public User getByUserId(@PathVariable Long id){
        //使用Feign调用用户服务获取User
        return userFeignClient.getByUserId(id);
    }
}
